﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="MvcPaging"%>  
<%@ Import Namespace="MensUnoShop.Helpers" %>
<%@ Import Namespace="MensUnoShop.Areas.Admin.Helpers" %>
<%@ Import Namespace="MensUnoShop.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Hansel
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<style>
    table#coupon td{border:1px solid #ccc;}
    
</style>
<%var combolist = ViewData["combolist"] as IPagedList<USalesKit>; %>
<div id="main-content" class="hastable">
    <div class="title title-spacing">
	    <h2>合購活動設定</h2>
    </div>

<br/>
<input type="button" onclick="location.href='/Admin/SalesKit/combosetup/0'" value="新增合購活動" />
<table id="coupon" style="width:900px;margin-top:30px;">
    <thead>
        <tr>
            <td width="50">序號</td>
            <td style="text-align:left">活動(標籤)名稱</td>
            <td width="80">開始日期</td>
            <td width="80">結束日期</td>
            <td width="40">狀態</td>
            <td width="230">操作</td>
        </tr>
    </thead>
    <tbody>
<%for (int i = 0; i < combolist.Count; i++)
  { %>
<tr>
    <td><%:i+1%></td>
    <td><%:combolist[i].SStitle%></td>
    <td class="center"><%:combolist[i].SSstartdate.Value.ToShortDateString()%></td>
    <td class="center"><%:combolist[i].SSenddate.Value.ToShortDateString()%></td>
    <td class="center"><%:combolist[i].SSstatus == true ? "顯示" : "隱藏"%></td>
    <td >
        <form action="" method="post" style="display:inline">
            <input type="hidden" name="ssguid" value="<%:combolist[i].SSguid %>" />
            <input type="hidden" name="Act" value="ChgStatus" />
            <%if (combolist[i].SSstatus)
              { %><input type="submit" name="cstatus" value="隱藏" /><%}else{ %><input type="submit" name="cstatus" value="開啟" /><%} %>
        </form>
        <form action="" method="post" onsubmit="return confirm('確定刪除?');" style="display:inline">
            <input type="hidden" name="ssguid" value="<%:combolist[i].SSguid %>" />
            <input type="hidden" name="Act" value="Del" />
            <input type="submit" name="cstatus" value="刪除" />
        </form>
        <input type="button" value="修改/設定條件" onclick="location.href='/Admin/SalesKit/combosetup/<%:combolist[i].SSguid %>'" />
    </td>
</tr>
<%} %>
    </tbody>
</table>
    <ul class="pagination" style="margin-top:-60px;">
            <%= Html.UPager(combolist.PageSize, combolist.PageNumber, combolist.TotalItemCount)%>
    </ul>
</div></asp:Content>
